<?php

namespace App\model;

use App\User;
use Illuminate\Database\Eloquent\Model;

/**
 * App\model\CustomerFollow
 *
 * @property int $follow_id
 * @property string|null $image
 * @property string|null $desc
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerFollow newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerFollow newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerFollow query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerFollow whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerFollow whereDesc($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerFollow whereFollowId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerFollow whereImage($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerFollow whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property int|null $customer_id
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerFollow whereCustomerId($value)
 * @property string|null $time
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerFollow whereTime($value)
 * @property int $user_id
 * @property-read \App\User $user
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\CustomerFollow whereUserId($value)
 */
class CustomerFollow extends Model
{
    protected $table='customer_follow';
    protected $primaryKey='follow_id';
    public function getImageAttribute($value)
    {
        return \Storage::url($value);
    }
    public function user(){
        return $this->belongsTo(User::class,'user_id');
    }
}
